<div id="left" style="border:solid 1px #E8E8E8">
    <div id="contact">
    	<p align="center" style="margin-bottom:20px"><img src="images/map-big.jpg" alt="map dieu thuan" /></p>
        <div id="info"><?php echo $row_config['contact_form'];?></div>
        <div id="form">
        	<table width="70%" border="0" cellspacing="20" cellpadding="0" style="margin-left:50px">
              <tr>
                <td colspan="2"><p style="font-size:160%; font-weight:bold">Form liên hệ</p></td>
              </tr>
              <tr>
                <td width="60">Name:</td>
                <td><input type="text" name="name" class="txt" /></td>
              </tr>
              <tr>
                <td>Email:</td>
                <td><input type="text" name="email" class="txt" /></td>
              </tr>
              <tr>
                <td>Tel:</td>
                <td><input type="text" name="phone" class="txt" /></td>
              </tr>
              <tr>
                <td valign="top">Message:</td>
                <td><textarea name="content" class="textarea"></textarea></td>
              </tr>
              <tr>
                <td width="100">&nbsp;</td>
                <td><input type="button" name="btnSend" class="btn" value="SENT" /></td>
              </tr>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
$(document).ready(function(e) {
    $("input[name=btnSend]").click(function(){
		var name = $("input[name=name]").val();
		var email = $("input[name=email]").val();
		var phone = $("input[name=phone]").val();
		var content = $("textarea[name=content]").val();
		if(name.length<3){
			alert("Input name");
			$("input[name=name]").focus();
			return false;
		}else if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))){
			alert("Wrong email address");
			$("input[name=email]").focus();
			return false;
		}else if(content.length<10){
			alert("Input Message");
			$("textarea[name=content]").focus();
			return false;
		}else{
			$("#form").html('<p style="font-weight:bold; padding:30px">Processing...</p>');
			$.post("ajax.php",{contact:"contact",name:name,email:email,phone:phone,content:content,lang:"<?php echo $lang;?>"},function(data){
				if(data!='0') setTimeout(function(){ $("#form").html('<p style="color:#0054B1; font-weight:bold; padding:30px 0 60px;">Send success.</p>'); },200);
				else $("#form").html('<p style="color:#F00; font-weight:bold; padding:30px 0 60px;">Undeliverable. Please press F5 to try again.</p>');
			});
			return true;
		}
	});
});
</script>